package com.hss.mvp.base;

import android.widget.Toast;

import com.hss.base.BaseFragment;
import com.hss.mvp.BaseMVPPresenter;
import com.hss.mvp.BaseMVPView;

/**
 * Created by Administrator on 2017/2/9.
 */

public abstract class BaseMVPFragment<T extends BaseMVPPresenter> extends BaseFragment implements BaseMVPView<T> {
    public T presenter;

    @Override
    public void setPresenter(T presenter) {
        this.presenter = presenter;
    }

    @Override
    public void onResume() {
        super.onResume();
        if (presenter != null) {
            this.presenter.attachView(this);
        }
    }


//    @Override
//    public void onStop() {
//        super.onStop();
//
//
//    }

    @Override
    public void onDestroyView() {
        if (presenter != null) {
            presenter.detachView();
        }
        super.onDestroyView();
    }

    @Override
    public void destoryRes() {

    }
}
